home *** CD-ROM | disk | FTP | other *** search
- /*
-
- NotPPC.c
-
- Source code for NotPPC application
-
- */
-
- #include <dialogs.h>
- #include <QuickDraw.h>
- #include <Dialogs.h>
- #include <Windows.h>
- #include <Resources.h>
- #include <Memory.h>
- #include "NotPPC.h"
-
-
- void main ()
- {
- short itemHit;
- AlertTHndl theAlertTemplate;
- Handle theDITLHandle;
- Handle theMessageHandle;
- Boolean canAlert;
-
- InitGraf ((Ptr)&qd.thePort);
- InitWindows ();
- InitDialogs (NULL);
-
- /* set cursor to an arrow */
- SetCursor (&qd.arrow);
-
- /* pre-flight everything first */
- theAlertTemplate = (AlertTHndl)GetResource ('ALRT', RESOURCE_ID); /* is the ALRT resource around? */
- theDITLHandle = GetResource ('DITL', (*theAlertTemplate)->itemsID); /* how about the DITL? */
- theMessageHandle = GetResource ('STR ', RESOURCE_ID); /* check the STR resource, too */
-
- CouldAlert (RESOURCE_ID); /* is there enough memory to handle the alert? */
- canAlert = (ResError() == noErr) && (MemError() == noErr);
- FreeAlert (RESOURCE_ID); /* free the memory */
-
- if ((theAlertTemplate) || (theDITLHandle) || (theMessageHandle) || (canAlert))
- {
- /* Success at last... */
- ParamText (*(theMessageHandle), "", "", ""); /* use the loaded STR resource to replace ^0 in alert's DITL */
- itemHit = Alert (RESOURCE_ID, nil); /* run the alert */
- }
- else
- {
- /* give some indication we're hosed... */
- SysBeep(2);
- }
- }
-
-
-